<?php

class StateMorning implements State
{
    public function writeProgram(Work $work)
    {
        if ($work->getHour() < 12) {
            fwrite(STDOUT, '上午' . $work->getHour() . '点，奋笔疾书中' . "\n");
        } else {
            $work->setState(new StateAfternoon());
            $work->writeProgram();
        }
    }
}